import Header from "./Header/Header";
import List from "./List/List"
import { useState } from 'react';
import PubSub from "pubsub-js";


import './centre.scss'
const Centre = (props) => {


    let [list, setList] = useState(
        {
            list: [
                {
                    title: "大数据扫黄，精准定位",
                    date: '2023-2-7',
                    priority: '1'
                },
                {
                    title: "美方拒还飞艇碎片和设备",
                    date: '2023-2-6',
                    priority: '2'
                }
            ]
        }
    )
    const pata = (val) => {
        let obj1 = list.list
        obj1.push(val)
        setList(() => { return { ...list, list: obj1 } })
    }


    return (<>
        <div className="box">
            <Header pata={pata} />
            <List list={list} />
        </div>
    </>)
}

export default Centre
